﻿//Complex 1D Array
namespace Diplom.NumericArrays
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class Complex1DArray
    {
        #region Fields

        /// <summary>
        /// Numeric array
        /// </summary>
        Complex[] raw;

        double timemax;

        double timemin;

        #endregion

        #region Methods

        /// <summary>
        /// Constructor
        /// </summary>
        public Complex1DArray()
        {
            raw = new Complex[100];
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="size">size of array</param>
        public Complex1DArray(int size)
        {
            raw = new Complex[size];
        }

        /// <summary>
        /// Вставка элемента по заданному индексу
        /// </summary>
        /// <param name="i"></param>
        /// <param name="item"></param>
        public void Insert(int i, Complex item)
        {
            raw[i] = item;
        }

        /// <summary>
        /// Объединение текущего массива с новым
        /// </summary>
        /// <param name="arrayAdd"></param>
        /// <returns></returns>
        public Complex1DArray Concat(ref Complex1DArray arrayAdd)
        {
            Complex1DArray newComplex1DArray = new Complex1DArray(this.Length + arrayAdd.Length);
            for (int i = 0; i < this.Length; i++)
            {
                newComplex1DArray.Items[i] = this.Items[i];
            }
            for (int i = 0; i < arrayAdd.Length; i++)
            {
                newComplex1DArray.Items[i + this.Length] = arrayAdd.Items[i];
            }
            
            return newComplex1DArray;
        }

        #endregion

        #region Properties
                
        /// <summary>
        /// Size
        /// </summary>
        public int Length
        {
            get
            {
                return raw.Length;
            }
        }

        /// <summary>
        /// Data
        /// </summary>
        public Complex[] Items
        {
            get
            {
                return raw;
            }
            set
            {
                raw = value;
            }

        }

        public Double TimeMax
        {
            get
            {
                return timemax;
            }
            set
            {
                timemax = value;
            }
        }

        public Double TimeMin
        {
            get
            {
                return timemin;
            }
            set
            {
                timemin = value;
            }
        }

        #endregion
    }
}
